﻿<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Survey.Entity.Services" assembly="Survey.Entity">

    <class name="User" table="ServicesUser" lazy="true">
        <cache usage="read-write" region="ShortTerm"/>
        <id name="ID" column="UserId">
            <generator class="assigned"></generator>
        </id>

        <property name="Login" not-null="true" />
        <property name="FirstName" not-null="true" />
        <property name="LastName" not-null="true" />
        <property name="CurrentRole" not-null="false" />

        <bag name="Roles" inverse="false" lazy="true" table="ServicesUserRole" cascade="all"
             batch-size="25" >
            <key column="UserId" />
            <element type="System.String" column="Role" />
        </bag>

    </class>

</hibernate-mapping>